package javaoop第二章;
  import java.util.*;
public class Visitor {
     String vname;
      int vage;
     
     public void vshow() {
    	 Scanner input=new Scanner(System.in);
    	 while(!vname.equals("n")) 
    	 {
    	 if(vage>=18&&vage<=60) 
    	 {
    		 System.out.println("年龄为："+vage+"门票为20元");
    		 
    	 }
    	 else 
    	 {
    		 System.out.println("年龄为："+vage+"门票免费");
    		 
    	 
    	 System.out.println("请输入你的姓名：");
    	  vname=input.next();
    	  if(!vname.equals("n"))
    	  {
    		  
    	  }
    	  System.out.println("请输入年龄:");
    	   vage =input.nextInt();
     
     }

}
    System.out.println("退出程序");
 }  
}